package security.internal;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import security.Role;
import security.RoleService;

public class RoleServiceImpl extends HibernateDaoSupport implements RoleService {

	public Role findRoleByName(String roleName) {
    	List<Role> list = null;
    	try {
            list = this.getHibernateTemplate().find("FROM Role WHERE roleName = ?", new Object[] { roleName});
		} catch (Exception e) {
			e.fillInStackTrace();
		}
    	
    	if (list.size() > 0) {
			return list.get(0);
		}
        return null;
    }

}
